#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

using namespace std;

int minMutation(string s, string e, vector<string>& b) {
    unordered_set<string> bank;
    unordered_set<string> visited;
    queue<string> q;
    int ret = 0;
    char str[] = { 'A' , 'C' , 'G' , 'T' };

    for (auto e : b)
        bank.insert(e);

    if (s == e)
        return 0;
    if (bank.count(e) == 0)
        return -1;

    q.push(s);
    visited.insert(s);

    while (!q.empty())
    {
        int size = q.size();
        ++ret;

        while (size--)
        {
            string tmp = q.front();
            q.pop();

            for (int i = 0; i < 8; ++i)
            {
                string t = tmp;
                for (int j = 0; j < 4; ++j)
                {
                    t[i] = str[j];

                    if (t == e)
                        return ret;

                    if (bank.count(t) && !visited.count(t))
                    {

                        q.push(t);
                        visited.insert(t);
                    }
                }
            }

        }

    }

    return -1;
}

int main()
{

	return 0;
}